/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { BaseResponse } from '../models/BaseResponse';
import type { BaseResponse_boolean_ } from '../models/BaseResponse_boolean_';
import type { BaseResponse_Competition_ } from '../models/BaseResponse_Competition_';
import type { BaseResponse_long_ } from '../models/BaseResponse_long_';
import type { BaseResponse_Page_Competition_ } from '../models/BaseResponse_Page_Competition_';
import type { BaseResponse_Page_CompetitionVO_ } from '../models/BaseResponse_Page_CompetitionVO_';
import type { CompetitionAddRequest } from '../models/CompetitionAddRequest';
import type { CompetitionQueryRequest } from '../models/CompetitionQueryRequest';
import type { CompetitionUpdateRequest } from '../models/CompetitionUpdateRequest';
import type { DeleteRequest } from '../models/DeleteRequest';

import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';

export class CompetitionControllerService {

    /**
     * addCompetition
     * @param competitionAddRequest competitionAddRequest
     * @returns BaseResponse_long_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static addCompetitionUsingPost(
competitionAddRequest: CompetitionAddRequest,
): CancelablePromise<BaseResponse_long_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/competition/add',
            body: competitionAddRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * deleteCompetition
     * @param deleteRequest deleteRequest
     * @returns BaseResponse_boolean_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static deleteCompetitionUsingPost(
deleteRequest: DeleteRequest,
): CancelablePromise<BaseResponse_boolean_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/competition/delete',
            body: deleteRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * getCompetitionById
     * @param id id
     * @returns BaseResponse_Competition_ OK
     * @throws ApiError
     */
    public static getCompetitionByIdUsingGet(
id?: number,
): CancelablePromise<BaseResponse_Competition_> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/api/competition/get',
            query: {
                'id': id,
            },
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * joinCompetition
     * @param competitionAddRequest competitionAddRequest
     * @returns BaseResponse OK
     * @returns any Created
     * @throws ApiError
     */
    public static joinCompetitionUsingPost(
competitionAddRequest: CompetitionAddRequest,
): CancelablePromise<BaseResponse | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/competition/join',
            body: competitionAddRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * listCompetitionByPage
     * @param competitionQueryRequest competitionQueryRequest
     * @returns BaseResponse_Page_Competition_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static listCompetitionByPageUsingPost(
competitionQueryRequest: CompetitionQueryRequest,
): CancelablePromise<BaseResponse_Page_Competition_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/competition/list/page',
            body: competitionQueryRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * listCompetitionVOByPage
     * @param competitionQueryRequest competitionQueryRequest
     * @returns BaseResponse_Page_CompetitionVO_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static listCompetitionVoByPageUsingPost(
competitionQueryRequest: CompetitionQueryRequest,
): CancelablePromise<BaseResponse_Page_CompetitionVO_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/competition/list/page/vo',
            body: competitionQueryRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

    /**
     * updateCompetition
     * @param competitionUpdateRequest competitionUpdateRequest
     * @returns BaseResponse_boolean_ OK
     * @returns any Created
     * @throws ApiError
     */
    public static updateCompetitionUsingPost(
competitionUpdateRequest: CompetitionUpdateRequest,
): CancelablePromise<BaseResponse_boolean_ | any> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/api/competition/update',
            body: competitionUpdateRequest,
            errors: {
                401: `Unauthorized`,
                403: `Forbidden`,
                404: `Not Found`,
            },
        });
    }

}
